/* eslint-disable */
/* tslint:disable */
/*
 * ---------------------------------------------------------------
 * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API        ##
 * ##                                                           ##
 * ## AUTHOR: acacode                                           ##
 * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
 * ---------------------------------------------------------------
 */

import {
  DynamicFilterInfo,
  DynamicFilterLogic,
  DynamicFilterOperator,
  PatrolTaskAddInput,
  PatrolTaskConfigInputs,
  PatrolTaskNodeDto,
  PatrolTaskProcessDto,
  ResultOutputBoolean,
  ResultOutputIListPatrolTaskPageOutput,
  ResultOutputInt64,
  ResultOutputPatrolTaskOutput,
} from './data-contracts'
import { ContentType, HttpClient, RequestParams } from './http-client'

export class ScheduleTaskApi<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
  /**
   * No description
   *
   * @tags schedule-task
   * @name Add
   * @summary 新增
   * @request POST:/api/admin/schedule-task/add
   * @secure
   */
  add = (data: PatrolTaskAddInput, params: RequestParams = {}) =>
    this.request<ResultOutputInt64, any>({
      path: `/api/admin/schedule-task/add`,
      method: 'POST',
      body: data,
      secure: true,
      type: ContentType.Json,
      format: 'json',
      ...params,
    })
  /**
   * No description
   *
   * @tags schedule-task
   * @name SetConfig
   * @summary 任务配置
   * @request POST:/api/admin/schedule-task/set-config
   * @secure
   */
  setConfig = (data: PatrolTaskConfigInputs, params: RequestParams = {}) =>
    this.request<ResultOutputBoolean, any>({
      path: `/api/admin/schedule-task/set-config`,
      method: 'POST',
      body: data,
      secure: true,
      type: ContentType.Json,
      format: 'json',
      ...params,
    })
  /**
 * No description
 *
 * @tags schedule-task
 * @name GetPage
 * @summary 查询任务列表
移动端
 * @request GET:/api/admin/schedule-task/get-page
 * @secure
 */
  getPage = (
    query?: {
      /**
       * 部门Id
       * @format int64
       */
      filterOrgId?: number
      /**
       * 当前页标
       * @format int32
       */
      CurrentPage?: number
      /**
       * 每页大小
       * @format int32
       */
      PageSize?: number
      dynamicFilterField?: string
      /** Contains=0,StartsWith=1,EndsWith=2,NotContains=3,NotStartsWith=4,NotEndsWith=5,Equal=6,Equals=7,Eq=8,NotEqual=9,GreaterThan=10,GreaterThanOrEqual=11,LessThan=12,LessThanOrEqual=13,Range=14,DateRange=15,Any=16,NotAny=17,Custom=18 */
      dynamicFilterOperator?: DynamicFilterOperator
      dynamicFilterValue?: any
      /** And=0,Or=1 */
      dynamicFilterLogic?: DynamicFilterLogic
      dynamicFilterFilters?: DynamicFilterInfo[]
    },
    params: RequestParams = {}
  ) =>
    this.request<ResultOutputIListPatrolTaskPageOutput, any>({
      path: `/api/admin/schedule-task/get-page`,
      method: 'GET',
      query: query,
      secure: true,
      format: 'json',
      ...params,
    })
  /**
 * No description
 *
 * @tags schedule-task
 * @name GetDetail
 * @summary 获取任务所有详情()
当前任务下的配置，配置表单以及表单的项
 * @request GET:/api/admin/schedule-task/get-detail
 * @secure
 */
  getDetail = (
    query?: {
      /**
       * 任务ID
       * @format int64
       */
      id?: number
    },
    params: RequestParams = {}
  ) =>
    this.request<ResultOutputPatrolTaskOutput, any>({
      path: `/api/admin/schedule-task/get-detail`,
      method: 'GET',
      query: query,
      secure: true,
      format: 'json',
      ...params,
    })
  /**
 * No description
 *
 * @tags schedule-task
 * @name StartTask
 * @summary 开始执行任务
移动端点击开始
 * @request POST:/api/admin/schedule-task/start-task
 * @secure
 */
  startTask = (
    query?: {
      /** @format int64 */
      id?: number
    },
    params: RequestParams = {}
  ) =>
    this.request<ResultOutputInt64, any>({
      path: `/api/admin/schedule-task/start-task`,
      method: 'POST',
      query: query,
      secure: true,
      format: 'json',
      ...params,
    })
  /**
   * No description
   *
   * @tags schedule-task
   * @name EndTask
   * @summary 任务结束
   * @request POST:/api/admin/schedule-task/end-task
   * @secure
   */
  endTask = (data: PatrolTaskProcessDto, params: RequestParams = {}) =>
    this.request<ResultOutputBoolean, any>({
      path: `/api/admin/schedule-task/end-task`,
      method: 'POST',
      body: data,
      secure: true,
      type: ContentType.Json,
      format: 'json',
      ...params,
    })
  /**
   * No description
   *
   * @tags schedule-task
   * @name UploadNode
   * @summary 上传事件点
   * @request POST:/api/admin/schedule-task/upload-node
   * @secure
   */
  uploadNode = (data: PatrolTaskNodeDto, params: RequestParams = {}) =>
    this.request<ResultOutputInt64, any>({
      path: `/api/admin/schedule-task/upload-node`,
      method: 'POST',
      body: data,
      secure: true,
      type: ContentType.Json,
      format: 'json',
      ...params,
    })
}
